Some computer systems use multiple processors for higher performance. Early multi-processor systems had a shared main memory to which all processors had access by means of a common bus. However since the bandwidth of the shared bus became a major bottleneck in this multi-processor system, other architectures were developed. Among them is an architecture known as a non-uniform memory access (NUMA) architecture, in which each processor operates on a shared address space but memory is distributed among the processor nodes and memory access time depends on the location of the data in relation to the processor that needs it.
In multiprocessor systems some variables are shared by the nodes. For example in a banking database system many different processors may be able to access a customer's account data. However it is important that only one processor node is allowed to be the owner of the data at a time, and that all processor nodes that are allowed to change the customer's account data receive the right to access the data at some point. Thus NUMA multiprocessor systems put a “lock” around the variable when one user is granted ownership of it, and only release the lock when it is safe to pass ownership rights to another user.
If a given processor node attempts to read a variable which is already owned and hence locked by another node, it is not allowed the right to change the variable until, at least, the owner relinquishes it. There may also be other processors that desire to own the variable at the same time and that may be given priority over the given processor. Hence each processor that attempts to become the owner of a shared variable must wait for the lock to be released and then attempt to acquire the lock before another processor does. Typically these processors can be stuck executing a tight loop of instructions known as a “spinlock” to detect the lock release and these processors are said to be “spinning”.
Spinlocks can cause unbalanced performance in NUMA systems. Performance instability results from the fact that nodes which are physically close to the home node of a lock variable have a higher probability of acquiring a released lock variable than nodes that are far away. The net effect is that remote nodes are under-utilized because they spend more time spinning and less time working. The utilization of the processor nodes literally becomes a function of their proximity to lock variables. Proximity in turn varies based on where tasks are scheduled and where memory is allocated. System performance thus becomes erratic and generally unstable.
Accordingly, it is desirable to provide a method and apparatus for providing stability in NUMA systems. This and other desirable features and characteristics of the present invention will become apparent from the subsequent detailed description and the appended claims, taken in conjunction with the accompanying drawings and the foregoing technical field and background.